﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Bas1a02
    {
		private string _chargename;
        private int? _chargecode;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 费用名称
        /// </summary>
		public string Chargename
		{
			get { return _chargename;	 }
			set { _chargename=value;	}
		}
        /// <summary>
        /// 费用代码
        /// </summary>
		public int? Chargecode
		{
			get { return _chargecode;	 }
			set { _chargecode=value;	}
		}
        /// <summary>
        /// 用户标识
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Bas1a02> GetBas1a02ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Bas1a02> list = new List<Bas1a02>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Bas1a02 model = GetBas1a02ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Bas1a02 GetBas1a02ByDataRow(DataRow dr)
		{
			Bas1a02 model = new Bas1a02(); //实例化Bas1a02
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("chargename")&&!(dr["chargename"] is System.DBNull))  
				model.Chargename = ( string)dr["chargename"];
			if (dcc.Contains("chargecode")&&!(dr["chargecode"] is System.DBNull))  
				model.Chargecode = ( int)dr["chargecode"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
